<script>
export default {
  name: "tao-table",
  props: {
    persons: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<template>
  <table class="layui-table">
    <thead>
    <tr><th>编号</th><th>姓名</th><th>年龄</th><th>地址</th><th>操作</th></tr>
    </thead>
    <tbody>
    <tr v-for="(item,index) in persons">
      <td>{{ index + 1 }}</td>
      <td>{{ item.name }}</td>
      <td>{{ item.age }}</td>
      <td>{{ item.address }}</td>
      <td>
       <slot :item="item"></slot>
      </td>
    </tr>
    </tbody>
  </table>
</template>

<style scoped lang="less">

</style>